<?php

$AD_SERVER_HTTP_HOST = $_SERVER['HTTP_HOST'];
if (!$AD_SERVER_HTTP_HOST) {
    $AD_SERVER_HTTP_HOST = 's.u631.com';
}

$TmpEmptyAdCode = array('method' => 'document.write', 'jscode' => '');
$GoogleAdsense_468x60 = array('method' => 'document.write', 'jscode' => '');

$GoogleAdsense_160x600 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="6616456704"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

$GoogleAdsense_728x90 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="6923770706"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

$GoogleAdsense_300x250 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="2034082703"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

$GoogleAdsense_300x600 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:300px;height:600px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="5279324304"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

$GoogleAdsense_336x280 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:336px;height:280px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="2291434705"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

#链接推广单元
$GoogleAdsense_Link_200x90 = $TmpEmptyAdCode;

$GoogleAdsense_970x60 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="6337255106"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');

$GoogleAdsense_250x250 = array('method' => 'document.write', 'jscode' => '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:inline-block;width:250px;height:250px" data-ad-client="ca-pub-6169161912390838" data-ad-slot="7813988304"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');


$CNZZ_TONGJI_1 = array('method' => 'document.write', 'jscode' => '<div style="display:none;"><script src="http://s5.cnzz.com/stat.php?id=5847114&web_id=5847114" language="JavaScript"></script></div>');
$CNZZ_TONGJI_2 = array('method' => 'document.write', 'jscode' => '<div style="display:none;"><script src="http://s5.cnzz.com/stat.php?id=5847115&web_id=5847115" language="JavaScript"></script></div>');


require_once dirname(__FILE__) . '/cnzz.php';

$Break = false;
foreach ($arrCNZZ_TongJiConfig as $TongJiKey => $arrTongJiConfig) {
    $domainlist = array_filter(explode('<br />', nl2br(trim($arrTongJiConfig['domains']))));
    foreach ($domainlist as &$ds) {
        $ds = trim($ds);
        $ds = str_replace('www.', '', $ds);
    }unset($ds);
    $arrTongJiDomains = array_filter($domainlist);
    foreach ($arrTongJiDomains as $TJDomain) {
        if (strpos('a' . $_SERVER['HTTP_REFERER'], $TJDomain)) {
            $CNZZ_TONGJI_1 = $CNZZ_TONGJI_2 = $arrTongJiConfig['js'];
            $Break = true;
            break;
        }
    }
    if ($Break) {
        break;
    }
}


//语言
$lang_english_download = 'You are not logged in, please login and then download.';
$lang_chinese_download = '您还没有登录，请先登录之后再进行相关操作。';

#$lang_english_download = 'The current file does not support download.';
#$lang_chinese_download = '当前文件暂不支持下载。';

$downloadChineseJsCode = "function Global_Download_Ajax_Http_Request(){
	var ImgNode=document.getElementById('UserLoginStatusCheckUniqImgBtn');
	ImgNode.src='http://{$AD_SERVER_HTTP_HOST}/images/loading_1.gif';
	setTimeout('Global_Download_LinK_Show()',600);
}
function Global_Download_LinK_Show(){
	alert('" . $lang_chinese_download . "');
	var ImgNode=document.getElementById('UserLoginStatusCheckUniqImgBtn');
	ImgNode.src='http://{$AD_SERVER_HTTP_HOST}/images/download.jpg';
}
document.write('<table border=\"0\" width=\"600\" style=\"border-collapse: collapse\"><tr><td width=\"250\"><a href=\"#d\" onclick=\"Global_Download_Ajax_Http_Request()\"><img id=\"UserLoginStatusCheckUniqImgBtn\" src=\" http://{$AD_SERVER_HTTP_HOST}/images/download.jpg\"  /></a></td><td align=\"right\"></td></tr></table>');";

$downloadEnglishJsCode = "function Global_Download_Ajax_Http_Request(){
	var ImgNode=document.getElementById('UserLoginStatusCheckUniqImgBtn');
	ImgNode.src='http://{$AD_SERVER_HTTP_HOST}/images/loading_1.gif';
	setTimeout('Global_Download_LinK_Show()',600);
}
function Global_Download_LinK_Show(){
	alert('" . $lang_english_download . "');
	var ImgNode=document.getElementById('UserLoginStatusCheckUniqImgBtn');
	ImgNode.src='http://{$AD_SERVER_HTTP_HOST}/images/download_en-us.jpg';
}
document.write('<table border=\"0\" width=\"600\" style=\"border-collapse: collapse\"><tr><td width=\"250\"><a href=\"#d\" onclick=\"Global_Download_Ajax_Http_Request()\"><img id=\"UserLoginStatusCheckUniqImgBtn\" src=\" http://{$AD_SERVER_HTTP_HOST}/images/download_en-us.jpg\"  /></a></td><td align=\"right\"></td></tr></table>');";

if ($IS_PINGBI_DOWNLOAD) {
    if ($tplVersion == 3 || $tplVersion == 2 || $tplVersion > 4) {
        //$downloadEnglishJsCode = 'document.write(\'The current file does not support download!\');';
        $downloadEnglishJsCode = 'document.write(\'Free Download\');';
        $downloadChineseJsCode = 'document.write(\'查看评论\')';
    }
}

$_download_english = array('method' => 'function', 'jscode' => $downloadEnglishJsCode);
$_download_chinese = array('method' => 'function', 'jscode' => $downloadChineseJsCode);
?>